package org.point.dao.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.point.common.dao.impl.BaseDaoImpl;
import org.point.common.util.DoPage;
import org.point.dao.TaskDao;
import org.point.domain.Task;
import org.springframework.stereotype.Repository;

/**
 * 
 * @ClassName: ConvertRuleDetailDaoImpl  
 * @Description: TODO(兑换规则明细数据实现类)  
 * @author Kenny_Z' szqiuk@gmail.com
 * @date 2016年10月23日 下午3:28:17  
 *
 */
@Repository("TaskDao")
public class TaskDaoImpl  extends BaseDaoImpl<Task, Serializable> implements TaskDao {

	private static final String SQLID_SEARCHFORTASKPAGE = "search_For_task_page";
	
	private static final String SQLID_SEARCHFORTASKCOUNT = "search_for_task_count";

	private static final String SQLID_SEARCHTASK = "search_userTask";

	public Integer searchForTaskCount(DoPage<Task> page) {
		Integer result = 0;
		try {
			result = getSqlSession().selectOne(namespace + SQLID_SEARCHFORTASKCOUNT, page);
		} catch (Exception e) {
			throw new RuntimeException("查询数据总记录数错误！", e);
		}
		return result;
	}

	public List<Task> searchForTask(DoPage<Task> page) {
		List<Task> records = null;
		try {
			records = getSqlSession().selectList(namespace + SQLID_SEARCHFORTASKPAGE, page);
		} catch (Exception e) {
			throw new RuntimeException("查询数据总记录数错误！", e);
		}
		return records;
	}

	public List<Task> searchTask(Map<String, Object> map) {
		List<Task> userSigns = getSqlSession().selectList(SQLID_SEARCHTASK);
		return userSigns;
	}

}
